<?php
namespace app\admin\validate;
use think\Validate;
class Area extends Validate {
    
    protected $rule=[
      ['name','require|max:10','area名不为空|area长度不超过10'],
      ['city_name','require|max:10','城市名不为空|城市长度不超过10'],
      ['parent_id','number'],
      ['city_id','number'],
      ['id','number'],
      ['status','number|in:-1,0,1','状态为数字|范围不合法'],
      ['listorder','number','排序为数字'],   
    ];
    
    /****场景设置****/
       protected  $scene=[
        "add"=>["name","city_id","city_name","parent_id","id"],   //添加场景
        "listorder"=>["listorder","id"],//排序场景
         "status"=>["status","id"],//状态场景
       ];
}

